Skip to content

feat: add generic flat bundles, replace bricks-branded bundle - #61

Merged
jackgranatowski merged 1 commit into
mainfrom
flat-bundles-v2
May 22, 2026
Merged

feat: add generic flat bundles, replace bricks-branded bundle#61
jackgranatowski merged 1 commit into
mainfrom
flat-bundles-v2

Conversation

@kiro-agent

@kiro-agent kiro-agent Bot commented May 22, 2026

Copy link
Copy Markdown

This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻

Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent


Adds generic *.flat.css bundles for every tier, replacing the single bricks-branded flat bundle.

Bundles produced in dist/

Layered Flat sibling
slashed.essential.css slashed.essential.flat.css
slashed.optimal.css slashed.optimal.flat.css
slashed.optimal-components.css slashed.optimal-components.flat.css
slashed.optimal-utilities.css slashed.optimal-utilities.flat.css
slashed.full.css slashed.full.flat.css

Each ships with .min.css + .min.css.map. Same minifier config (lightningcss, no down-levelling).

Consumer-facing API

// Layered (cascade-managed) — unchanged
import 'slashed';                       // = slashed/full
import 'slashed/essential';
import 'slashed/optimal';
// …

// Flat (unlayered) — new
import 'slashed/flat';                  // = slashed/full/flat (convenience alias)
import 'slashed/essential/flat';
import 'slashed/optimal/flat';          // same file set as the old slashed/bricks
import 'slashed/optimal-components/flat';
import 'slashed/optimal-utilities/flat';
import 'slashed/full/flat';

What changed

  • bundle.config.json — five new flat: true entries; bricks entry removed.
  • package.json./bricks export removed; new ./flat and ./<tier>/flat exports added.
  • scripts/bundle.js — comment in stripLayerWrappers genericised (no longer references Bricks Builder by name).
  • dist/ — stale slashed.bricks.* files removed; new *.flat.{css,min.css,min.css.map} siblings emitted.
  • package-lock.json — incidental: lockfile version field synced to 0.2.10 (was drifting at 0.2.5).

Tested

  • node scripts/bundle.js produces all 10 layered + flat bundles cleanly.
  • Spot-check: slashed.full.flat.css has 0 top-level @layer declarations vs 17 in slashed.full.css — strip works as intended.
  • Pre-commit hook ran (lint + rebuild + restage) on commit.

Versioning

Lands as 0.2.11 under .release-it.json's hardcoded "increment": "patch" + "ignoreRecommendedBump": true. Replaces #60.

Summary by CodeRabbit

  • New Features

    • Added flat CSS bundle variants for all optimization levels (essential, optimal, optimal-components, optimal-utilities, full) available via new import subpaths.
  • Chores

    • Removed ./bricks export subpath.
    • Updated internal documentation.

Review Change Stack

Replace the single slashed.bricks.css flat bundle with a generic
*.flat.css sibling for each tier (essential, optimal,
optimal-components, optimal-utilities, full).

- bundle.config.json: five new flat:true entries; bricks entry removed
- package.json: ./bricks export removed; new ./flat and ./<tier>/flat
  exports added (./optimal/flat is the same file set as the old bricks
  bundle)
- scripts/bundle.js: stripLayerWrappers comment genericised
- dist/: stale slashed.bricks.* files removed; new
  *.flat.{css,min.css,min.css.map} siblings emitted
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR extends the bundle system with flattened CSS variants. Five new flat bundle configurations are added to bundle.config.json for essential, optimal, optimal-components, optimal-utilities, and full tiers, each with flat: true and corresponding CSS input file lists. Public subpath exports in package.json are updated to expose these new flat builds (and remove the .bricks export), allowing users to import pre-flattened CSS alongside existing layered outputs.

Changes

Flat Bundle Outputs and Public Exports

Layer / File(s) Summary
Flat bundle configuration definitions
bundle.config.json
Five new bundle entries with flat: true are defined for essential, optimal, optimal-components, optimal-utilities, and full tiers, each enumerating corresponding CSS inputs and producing separate flattened outputs (dist/slashed.*.flat.css).
Package exports for flat CSS variants
package.json
Exports map is updated with six new subpath entries (./essential/flat, ./optimal/flat, ./optimal-components/flat, ./optimal-utilities/flat, ./full/flat, ./flat), all pointing to their respective flat CSS outputs; the ./bricks export is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#60: Adds the same flat bundle configurations and export subpaths with a related comment generalization in scripts/bundle.js.
  • codeslash-dev/SLASHED#59: Introduces the foundational flat: true bundling feature that this PR extends across multiple CSS tiers and export variants.
  • codeslash-dev/SLASHED#4: Establishes the original bundle.config.json-driven bundling system and package.json export subpaths that form the base for flat variant additions.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding generic flat bundles for each tier and replacing the bricks-branded bundle with a more general approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch flat-bundles-v2

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 12-21: Add back a compatibility export for the removed subpath by
adding an exports entry for "./bricks" that points to the existing optimal flat
bundle; specifically add "./bricks": "./dist/slashed.optimal.flat.css" alongside
the current "./optimal/flat" -> "./dist/slashed.optimal.flat.css" mapping in
package.json exports so imports of "slashed/bricks" continue to resolve (you can
mark it deprecated in your release notes if desired).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c4417ca2-217e-4c6e-a491-9a995a15b0da

📥 Commits

Reviewing files that changed from the base of the PR and between 4d0103e and 8897e07.

⛔ Files ignored due to path filters (27)
  • dist/slashed.bricks.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.essential.flat.css is excluded by !**/dist/**
  • dist/slashed.essential.flat.min.css is excluded by !**/dist/**
  • dist/slashed.essential.flat.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.essential.min.css is excluded by !**/dist/**
  • dist/slashed.essential.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.full.flat.css is excluded by !**/dist/**
  • dist/slashed.full.flat.min.css is excluded by !**/dist/**
  • dist/slashed.full.flat.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.full.min.css is excluded by !**/dist/**
  • dist/slashed.full.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.optimal-components.flat.css is excluded by !**/dist/**
  • dist/slashed.optimal-components.flat.min.css is excluded by !**/dist/**
  • dist/slashed.optimal-components.flat.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.optimal-components.min.css is excluded by !**/dist/**
  • dist/slashed.optimal-components.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.optimal-utilities.flat.css is excluded by !**/dist/**
  • dist/slashed.optimal-utilities.flat.min.css is excluded by !**/dist/**
  • dist/slashed.optimal-utilities.flat.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.optimal-utilities.min.css is excluded by !**/dist/**
  • dist/slashed.optimal-utilities.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.optimal.flat.css is excluded by !**/dist/**
  • dist/slashed.optimal.flat.min.css is excluded by !**/dist/**
  • dist/slashed.optimal.flat.min.css.map is excluded by !**/dist/**, !**/*.map
  • dist/slashed.optimal.min.css is excluded by !**/dist/**
  • dist/slashed.optimal.min.css.map is excluded by !**/dist/**, !**/*.map
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • bundle.config.json
  • package.json
  • scripts/bundle.js

Comment thread package.json
Comment on lines +12 to +21
"./essential/flat": "./dist/slashed.essential.flat.css",
"./optimal": "./dist/slashed.optimal.css",
"./bricks": "./dist/slashed.bricks.css",
"./optimal/flat": "./dist/slashed.optimal.flat.css",
"./optimal-components": "./dist/slashed.optimal-components.css",
"./optimal-components/flat": "./dist/slashed.optimal-components.flat.css",
"./optimal-utilities": "./dist/slashed.optimal-utilities.css",
"./optimal-utilities/flat": "./dist/slashed.optimal-utilities.flat.css",
"./full": "./dist/slashed.full.css",
"./full/flat": "./dist/slashed.full.flat.css",
"./flat": "./dist/slashed.full.flat.css",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify export keys and check for existing references to the removed subpath.
python - <<'PY'
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
print("has ./bricks export:", "./bricks" in exports)
print("flat exports:", [k for k in exports if "flat" in k])
PY

# Internal references that may already rely on old path naming
rg -nP "slashed/bricks|['\"]\\./bricks['\"]|slashed\\.bricks\\.css" -g '!dist/**'

Repository: codeslash-dev/SLASHED

Length of output: 227


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show relevant part of package.json around the exports map
python - <<'PY'
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
# Print keys in sorted order with their values (compact)
for k in sorted(exports.keys()):
    if "bricks" in k or k.startswith("./") and ("flat" in k or k in ["./bricks","./optimal/flat","./flat"]):
        print(k, "=>", exports[k])
PY

echo "---- package.json grep for bricks ----"
rg -n "bricks" package.json || true

echo "---- repo grep for bricks (excluding dist) ----"
rg -nP "slashed/bricks|['\"]\\./bricks['\"]|slashed\\.bricks\\.css" -g '!dist/**' || true

Repository: codeslash-dev/SLASHED

Length of output: 481


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python - <<'PY'
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
keys=list(exports.keys())
for i,k in enumerate(keys):
    if k in ("./bricks","./core/*","./optional/*","./optimal/flat","./flat"):
        print(i,k,"=>",exports[k])
PY

python - <<'PY'
# Print a small excerpt of the exports keys in order (best-effort)
import json
p=json.load(open("package.json"))
exports=p.get("exports", {})
keys=list(exports.keys())
for k in keys[:40]:
    print(k,"=>",exports[k])
PY

Repository: codeslash-dev/SLASHED

Length of output: 863


Preserve ./bricks as a compatibility export (or ship an intentional major breaking change).

Dropping the ./bricks subpath from package.json will break existing consumers importing slashed/bricks at resolution time. Add a deprecated alias pointing to the existing ./optimal/flat bundle (./dist/slashed.optimal.flat.css).

Suggested compatibility patch
     "./full": "./dist/slashed.full.css",
     "./full/flat": "./dist/slashed.full.flat.css",
     "./flat": "./dist/slashed.full.flat.css",
+    "./bricks": "./dist/slashed.optimal.flat.css",
     "./core/*": "./core/*",
     "./optional/*": "./optional/*"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 12 - 21, Add back a compatibility export for the
removed subpath by adding an exports entry for "./bricks" that points to the
existing optimal flat bundle; specifically add "./bricks":
"./dist/slashed.optimal.flat.css" alongside the current "./optimal/flat" ->
"./dist/slashed.optimal.flat.css" mapping in package.json exports so imports of
"slashed/bricks" continue to resolve (you can mark it deprecated in your release
notes if desired).

@jackgranatowski
jackgranatowski merged commit dc08b40 into main May 22, 2026
3 of 4 checks passed
@jackgranatowski
jackgranatowski deleted the flat-bundles-v2 branch May 31, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant